package com.song.service;

import com.song.dao.StudentDao;
import com.song.pojo.Student;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author 宋伟宁
 * @Date 2024/1/15
 * @Version 1.0
 **/

@Transactional(isolation = Isolation.READ_COMMITTED,propagation = Propagation.REQUIRED)
public interface StudentService {

      @Transactional(readOnly = true)
      List<Student> findAll();

      @Transactional(readOnly = true)
      Student findById(Integer id);

      void add(Student student);

}
